package wuchaofei.top.shardingdbtable.data;

import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;

import java.util.Collection;
import java.util.Date;

public class QuestionRecordPreciseShardingAlgorithm implements PreciseShardingAlgorithm<Date> {
    /**
     * Sharding.
     *
     * @param availableTargetNames available data sources or tables's names
     * @param shardingValue        sharding value
     * @return sharding result for data source or table's name
     */
    @Override
    public String doSharding(Collection<String> availableTargetNames, PreciseShardingValue<Date> shardingValue) {
        return ShardingUtils.quarterPreciseSharding(availableTargetNames, shardingValue);
    }
}
